<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.ufida.ebscg.comm.Constant"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<jsp:include page="../checksession.jsp"></jsp:include>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>招商银行供应商门户-采购创造价值_商务协同_商务应答_执行中项目_下载招标文件</title>
<link href="../css/style.css" rel="stylesheet" type="text/css" />
<link href="../css/style_add.css" rel="stylesheet" type="text/css" />
<link href="css/collcss.css" rel="stylesheet" type="text/css" />

<script language="JavaScript" type="text/javascript" src="../javascript/caltimer.js"></script>
<script language="JavaScript" type="text/javascript" src="../javascript/ajaxdeal.js"></script>

</head>

<body style="width:610px">


<%if(Constant.CAOPEN){ %>
<OBJECT id="CertSignAtl"  height="0" hspace="0" width="0" align="center" classid="clsid:4FEA81CE-00EA-4FB2-850E-353C947B7A66" VIEWASTEXT>
</OBJECT>  
<%} %>
<div id="main">
<div id="right">
  <table  border="0">
    <tr>
      <td height="30" class="f-12-333333">项目名称：<span class="f-16-b-000000">${projectname}</span></td>
    </tr>
  </table>
  <table  border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td ><img src="images/yingda_zbj_001.jpg" width="13" height="76" border="0" /></td>
      <td  background="images/yingda_zbj_002.jpg"><img src="images/yingda_z_001.jpg" width="64" height="63" border="0" /></td>
      <td  valign="top" background="images/yingda_zbj_002.jpg"><table width="215" border="0" cellpadding="0" cellspacing="0" height="62">
        <tr>
          <td height="36"  colspan="8" valign="middle" class="f-14-e57c00">距离投标截止日期还有</td>
        </tr>
        <tr>
          <td width="26" align="center" bgcolor="#e57c00" class="f-20-b-ffffff" id="day"></td>
          <td align="center" class="f-14-b-000000">天</td>
          <td width="27" align="center" bgcolor="#e57c00" class="f-20-b-ffffff" id="hour"></td>
          <td align="center" class="f-14-b-000000">时</td>
          <td width="27" align="center" bgcolor="#e57c00" class="f-20-b-ffffff" id="minute"></td>
          <td align="center" class="f-14-b-000000">分</td>
          <td width="27" align="center" bgcolor="#e57c00" class="f-20-b-ffffff" id="second"></td>
          <td align="center" class="f-14-b-000000">秒</td>
        </tr>
      </table></td>
      <td width="10" align="left" background="images/yingda_zbj_002.jpg"><img src="images/yingda_zbj_004.jpg" width="1" height="57" border="0" /></td>
      <td background="images/yingda_zbj_002.jpg" class="f-12-F60000">注意：请在应答截止时间前进行应答，超过应答截止时间后进行的应答操作为无效操作！</td>
      <td width="13"><img src="images/yingda_zbj_003.jpg" alt="" width="13" height="76" border="0" /></td>
    </tr>
  </table>
  <table  border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td width="128" height="15" ></td>
      <td width="176" ></td>
      <td width="96" ></td>
      <td width="210" >&nbsp;</td>
    </tr>
    <tr>
      <td height="35" align="right">发标标题：&nbsp;</td>
      <td align="left">${steppub.release_title }</td>
      <td align="right"> 投标截止日期：&nbsp;</td>
      <td align="left">${steppub.bid_end_ts }</td>
    </tr>
    <tr>
      <td height="35" align="right">发布时间：&nbsp;</td>
      <td align="left">${steppub.release_date }</td>
      <td align="right">开启时间：&nbsp;</td>
      <td align="left">${steppub.unite_open_ts }</td>
    </tr>
    <tr>
      <td height="35" align="right">发布机构：&nbsp;</td>
      <td align="left">${steppub.pk_corp }</td>
      <td align="right">发布人：&nbsp;</td>
      <td align="left">${steppub.pk_person }</td>
    </tr>
    <tr>
      <td align="right" valign="top">内容：&nbsp;</td>
      <td colspan="3" align="left" valign="bottom"><div style="height:80px; overflow:auto;word-break:break-all;word-wrap:break-word;">
        <p>${steppub.release_text }</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
      </div></td>
    </tr>
    <tr>
      <td >&nbsp;</td>
    </tr>
  </table>
  

 <form name="downfile"  method="post">
 <input type="hidden" name="sign" id="sign"/>

  <table  border="0" cellpadding="0" cellspacing="0" height="120" class="xian">
   <tr>
      <td valign="bottom" colspan="5" class="f-13-b-2a6ca7" >采购文件附件</td>
    </tr>
    <tr>
      <td valign="middle"><table  border="0" cellpadding="0" cellspacing="0">
          <tr class="th_bj">
            <td width="121" height="28" align="center" class="f-12-b-ffffff"  >序</td>
            <td width="146" height="28" align="center"  ><span class="f-12-b-ffffff">文件名称</span></td>
            <td width="111" height="28" align="center"  ><span class="f-12-b-ffffff">备注</span></td>
            <td width="132" height="28" align="center"  ><span class="f-12-b-ffffff">下载</span></td>
            <td width="100" height="28" align="center" class="f-12-b-ffffff"  >签名</td>
          </tr>
          
           <logic:iterate id="att" name="atts">
        
	         <tr>
	          <td height="35" align="center" >${att.index }</td>
	          <td align="center" >${att.filename }</td>
	          <td align="center" >&nbsp;</td>
	          <td align="center" ><img src="../images/botton_downloading.jpg" width="59" height="21" border="0" style="cursor:hand" 
	            onclick=<%if(Constant.CAOPEN){%>"downfilefun('${att.pk_da_att}','${att.filename}')"<%}else{%>"downfilefun('${att.pk_da_att}','${att.filename}')"<%}%>/></td>
	          <td align="center" ><img src="../images/botton_signature-.jpg" width="59" height="21" border="0" style="cursor:hand"  onclick="supquoteSign('${steppub.pk_xy_step_pub}')"/></td>
	        </tr>
	      </logic:iterate>
      </table></td>
    </tr>
  </table>
  <input type="hidden" value= "${steppub.status}" id="status"/>
  <p class="protext" id="div_content" name="div_content"><br/>
</p>
</form>

<form name="writememo" method="post">

	<input type="hidden" name="type" value="3"/>
	<input type="hidden" name="pk_xy_proj_main" value="${pk_xy_proj_main}" />
	<!-- 供应商应答说明 -->
	<table width="610" border="0" cellpadding="0" cellspacing="0">
	
	<tr>
		<td colspan='2'>&nbsp;</td>
	</tr>
	   <tr>
	          <td width="12%" align="left" valign="top">说明：</td>
	          <td width="88%"><textarea name="memo" id="textarea2" cols="68" rows="10">${memo}</textarea></td>
	    </tr>
		<tr>
		
			<td colspan='2' align='center'><img src="../images/botton_submit.jpg" 
			width="60"  style="cursor:hand" height="20" border="0" onclick="submitValue()"/></td>
		</tr>
	</table>
</form>
 </div>
 </div>

<script language="vbscript">

		function downandsign(attpk,filename)
			
		Dim strPlaintext
		Dim strSignature
		Dim strCert
		Dim ret
			
		ret = 0 rem ret 必须赋初值
		
		if IsNull(CertSignAtl) = True then
			alert("请确认您是否有权限下载文件")
			return
		end if
		
		CertSignAtl.SignData ret, filename, strSignature
		
		If ret = 0 Then
				call downfilefun(attpk,strSignature)
		ElseIf ret = 100 Then

		Else
				Alert("下载文件出现问题")
		End If

		end function

</script>

<script language = "javascript">

parent.hideHideFun();

var message = "${dealmessage}";


if(message != ""){
	parent.showHideFun();
	parent.changeShowMessage(message,'yes','ok');	
}
var update_mode = '${update_mode}';

/*
	提交供应商说明信息
*/
function submitValue()
{
	var status = document.getElementById("status");
	
	var submitstate = document.getElementById("status");
	if(submitstate.value != '3'){
	
		showmess("应答已经结束不能进行应答!");
		return;
	}
	if(change.distance <= 0 ){
	
		showmess("应答已经过期不能进行应答!");
		return;
			
	}
	//判断供应商状态是否符合应答要求
	if(update_mode != 1)
	{
		showmess("供应商已经被废弃或淘汰不能进行签名");
	}
	
	if(change.distance >0 && status.value == 3)
	{
		parent.showHideFun();
		parent.changeShowMessage("数据处理中,请等候.....");
		document.writememo.submit();
	}
}


function SignFlag()
{
	this.flag = 1;
}
var sign = new SignFlag();
//使用ajax调用签名方法
function supquoteSign(pk)
{
//判断项目环节是否执行完毕，和应答时间是否已经结束
	var status = document.getElementById("status");
	
	var submitstate = document.getElementById("status");
	if(submitstate.value != '3'){
	
		showmess("应答已经结束不能进行应答!");
		return;
	}
	if(change.distance <= 0 ){
	
		showmess("应答已经过期不能进行应答!");
		return;
			
	}
	//判断供应商状态是否符合应答要求
	if(update_mode != 1)
	{
		showmess("供应商已经被废弃或淘汰不能进行签名");
	}
	
	if(change.distance >0 && status.value == 3)
	{
		var url = "downfile.do?type=2&pk_xy_step_pub="+pk+"&"+Math.random()+"&pk_xy_proj_main=${pk_xy_proj_main}";
		parent.showHideFun();
		parent.changeShowMessage("开始签名!");
			ajax(url,returnFunction);
	}
}

function returnFunction(value)
{
	if(value != null)
	{
		if(value == "ok")
		{
			parent.changeShowMessage("签名成功!",'yes','ok');	
		}else
		{
			parent.changeShowMessage("签名失败!",'yes','ok');	
		}
	}else
	{
		parent.changeShowMessage("签名失败!",'yes','ok');	
		
	}
}

//下载文件
function downfilefun(attpk,filename)
{
//判断项目环节是否执行完毕，和应答时间是否已经结束
	var status = document.getElementById("status");
	
	var submitstate = document.getElementById("status");
	if(submitstate.value != '3'){
	
		showmess("应答已经结束不能进行应答!");
		return;
	}
	if(change.distance <= 0 ){
	
		showmess("应答已经过期不能进行应答!");
		return;
			
	}
	
	//判断供应商状态是否符合应答要求
	if(update_mode != 1)
	{
		showmess("供应商已经被废弃或淘汰不能进行签名");
	}
	
	if(change.distance >0 )
	{
		
		try{
		document.downfile.sign.value = filename;
		}catch(e){
		}
		document.downfile.action = "downfile.do?pk_da_att="+attpk+"&type=1&pk_xy_proj_main=${pk_xy_proj_main}";
		
		
		document.downfile.submit();
	}
}


var change  = new timechange();

//设置时间长度
change.setDistance(${dismill});

wakeInterval();
</script>
</body>
</html>
